package com.zrrd.javaSEPlus._03_classLoader;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author WanJl
 * @version 1.0
 * @title ClassLoader02
 * @description
 * @create 2023/11/12 10:57
 */
public class ClassLoader02 {
    public static void main(String[] args) throws IOException {
        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //利用类加载器去加载一个指定的文件
        //文件放到了src目录下。
        InputStream is = systemClassLoader.getResourceAsStream("prop.properties");

        Properties properties = new Properties();
        properties.load(is);

        System.out.println(properties);
        is.close();
    }
}
